<template>
<view :tt:for="content" tt:key="index" class="list" @tap="goHome" :data-cardId="item.userId">
  <image :src="item.img" mode="scaleToFill" class="list-img"></image>
  <view class="list-name">
    <text>{{item.name}}</text>
    <text>{{item.category}}</text>
  </view>
  <view class="list-company">
    <text>{{item.company}}</text>
  </view>
</view>
</template>

<script>

export default {
  data() {
    return {};
  },

  components: {},
  props: {
    content: {
      type: Array,
      default: []
    }
  },
  methods: {
    goHome(e) {
      tt.navigateTo({
        url: `/pages/card/home/home?card=${e.currentTarget.dataset.cardId}` // 指定页面的url

      });
    }

  }
};
</script>
<style>
/* components/list/list.ttss */

.list {
    width: 95%;
    height: 160rpx;
    margin: 2.5%;
    border: 1px solid #888888;
}

.list-name {
    display: inline;
}

.list-img {
    float: left;
    padding: 20rpx;
    text-align: center;
    width: 20%;
    height: 120rpx;
}

.list-company {
    color: #888888;
}
</style>